import numpy as np

#
# list1 = [[1,2,3,4],[4,5,6,8],[7,8,9,3]]
#
# array1 = np.array(list1)
# print(array1, type(array1))
#
# print(array1.ndim) # 2
# print(array1.shape) # (3, 4)
# print(array1.size) # 12
# print(array1.dtype) # int32

# list1 = [[1,2,3],[4,5,6]]
# list1 = [[11, [1],[2],[3]],[11, [4],[5],[6]]]
# array1 = np.array(list1)
# print(array1, array1.ndim)

# list1 = [[1, 2, 3, 4], [4, 5, 6, 8], [7, 8, 9, 3]]
#
# array1 = np.array(list1)
# print(array1, type(array1))
# print(array1.dtype)
# print("--------------------")
# # print(array1[:, :2])
# # print("--------------------")
# # print(array1[1, 1:3])
# print("--------------------")
# array1 = array1.astype('float')
# print(array1, type(array1))
# print(array1.dtype)
# res1 = np.split(array1, [1, -1], axis=1)
# print(res1, type(res1))
# print(array1[array1>=7])
# array1 = array1.reshape(4,5)
# print(array1)

list1 = [[1, 2, 3, 4], [4, 5, 6, 8], [7, 8, 9, 3]]
list2 = [[11, 22, 33, 44], [55, 54, 236, 81], [72, 82, 49, 53],[72, 82, 49, 53]]

array1 = np.array(list1)
array2 = np.array(list2)
print(array1, type(array1))
print(array1.dtype)
print(array2, type(array2))
print(array2.dtype)
print("--------------------")
# res1 = np.vstack((array1[0],array2[1]))
# print(res1,type(res1))
# print(array1+array2)
# print(array1.dot(array2))
# res1 = np.diff(array1,axis=1)
# print(res1, type(res1))

print(np.amax(array1))
print(np.amin(array1))
print(np.mean(array1)) # 平均值
print(np.median(array1)) # 中位数
print(np.std(array1)) # 2.48327740429189 标准差
print(np.var(array1)) # 6.166666666666667 方差   比如计算偏科这样的需求

res2 = np.random.rand(3,4)
print(res2,type(res2))

